updateVariable

fun updateVariable(newValue: String)

Updates the LiveData's value asynchronously. This method uses postValue() and is safe to call from any thread (Main or Background). The LiveData observers will receive the update on the main thread shortly after this call. If postValue() is called multiple times rapidly from background threads, only the last value posted before the main thread processes the update will be delivered.

Parameters

newValue

The new string value to post.